<template>
  <a-modal
    :visible="visible"
    :afterClose="hanldeAfterClose"
    @cancel="close"
    @ok="close"
    :width="1200"
    title="查看租金标准"
  >
    <a-spin :spinning="spinning">
      <a-descriptions bordered :column="2">
        <a-descriptions-item label="标准名称"> {{ rentData.StandardName }} </a-descriptions-item>
        <a-descriptions-item label="辅助说明"> {{ rentData.AuxiliaryExplain }} </a-descriptions-item>
        <a-descriptions-item label="减免对象"> {{ rentData.ReductionObject }} </a-descriptions-item>
        <a-descriptions-item label="减免比例"> {{ rentData.ReductionProportion }}% </a-descriptions-item>
        <a-descriptions-item label="减免期限" :span="2"> {{ rentData.ReductionTerm }} </a-descriptions-item>
        <a-descriptions-item label="制定部门"> {{ rentData.FormulateDepartment }} </a-descriptions-item>
        <a-descriptions-item label="制定时间"> {{ rentData.Timing | moment }} </a-descriptions-item>
        <a-descriptions-item label="文件号"> {{ rentData.FileNumber }} </a-descriptions-item>
        <a-descriptions-item label="文件内容"> {{ rentData.FileContents }} </a-descriptions-item>
        <a-descriptions-item label="备注" :span="2"> {{ rentData.Remark }} </a-descriptions-item>
        <a-descriptions-item label="修改时间"> {{ rentData.UpdateTime | moment }} </a-descriptions-item>
      </a-descriptions>
      <fileList
        v-if="visible"
        ref="fileList"
        category="SCTP"
        tableNames="RentReductStandardManage"
        :fieldNames="{ label: 'DROPVALUE', value: 'DROPKEY' }"
        :fileList="rentData.SCWJJH"
        :option="{
          disabled:true
        }"
      ></fileList>
    </a-spin>
  </a-modal>
</template>

<script>
import { getRentReductStandardManageDetail } from '@/api/followUpManagement'
import { fileList } from '@/components'

export default {
  components: {
    fileList
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    data: {
      type: Object,
      default: () => {}
    }
  },
  watch: {
    visible (n) {
      if (n) {
        this.fetchData()
      }
    }
  },
  data () {
    return {
      rentData: {},
      spinning: false
    }
  },
  methods: {
    fetchData () {
      this.spinning = true
      getRentReductStandardManageDetail({
        id: this.data.ID
      })
        .then((res) => {
          this.rentData = res
        })
        .finally(() => {
          this.spinning = false
        })
    },
    close () {
      this.rentData = {}
      this.$emit('update:visible', false)
      this.$emit('update:data', {})
    },
    hanldeAfterClose () {}
  }
}
</script>
<style lang="less" scoped>
</style>
